package reflect;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:周次煜
 * Date: 2024-04-28
 * Time：16:18
 */


public class Reflect{
    //私有属性name
    private String name = "bit";

    //公有属性age
    public int age = 19;
    //不带参数的构造方法

    public Reflect(){
        System.out.println("Student()");
    }

    private Reflect(String name,int age) {
        this.name = name;
        this.age = age;
        System.out.println("Student(String,name)");
    }

    private void eat(){
        System.out.println("i am eat");
    }

    public void sleep(){
        System.out.println("i am pig");
    }

    private void function(String str) {
        System.out.println(str);
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }


}
